The present invention relates to a method of storing data employing an auxiliary storage of the type having a comparatively small capacity.
In a conventional programmable controller (referred to as a PC hereinafter) monitoring equipment is generally used to monitor a controlled object device and collect input/output data flowing between the PC and the control device which data is related to the control process. The collected data is inputted to the monitoring equipment from or via the PC and stored in an auxiliary storage.
FIG. 5 is a block diagram showing the constitution of a PC and its monitoring equipment. In FIG. 5, numeral 1 designates the PC, which comprises a CPU unit 2, a communication I/F unit 3, an input unit 4 and an output unit 5. Numeral 6 designates an object device to be controlled by means of PC 1, connected to the PC through a cable. Numeral 8 designates the monitoring equipment, 9, a communication means; 10, a CPU; 11, an operation range memory; 12, a system program memory; 13, a time measuring means; 14, an auxiliary storage; 15, a keyboard used as an input means, and 16, a display unit.
The monitoring equipment 8 comprised of the aforementioned elements 9-16 is connected to the PC 1 through connecting cable 17.
FIG. 6 is a flow chart showing the schema of the system program of the monitoring equipment 8, which flow chart is performed by accessing the system program stored in the system memory 12 shown in FIG. 5, by means of the CPU 10. The collection, compilation and the like of the input/output data related to the control process are performed at the time of monitoring the object device 6 by means of the monitoring equipment.
FIGS. 7 and 8 are flow charts showing in detail the processing steps of data collection and file compilation in the flow chart shown in FIG. 6.
FIG. 9 is a view showing the relation of the respective files stored in the auxiliary storage 14 in FIG. 5. In FIG. 9, 43 designates a collected data storage file which stores, in a time series manner, data collected at predetermined times. In each file 43, the data 45 indicates the collection time and 46 indicates the collected data obtained through the PC 1 and stored in order of collection. Numeral 44 designates a compilation file for extracting from the files 43 and storing such portions required for preservation, in which compilation file 44 the data 45 indicating the collection time and the collected data 46 obtained through the PC are stored.
The operation of this system will now be explained. In FIG. 5, the PC 1 computes input information concerning the object device 6 input through the input unit 4, by means of the CPU unit 2, and controls the object device 6 through the output unit 5 according to the computed results. The results obtained by the computation of the CPU unit 2 are transmitted to the communication means 9 of the monitoring equipment 8 through the communication I/F unit 3 and the connection cable 17. The monitoring equipment 8 writes the data received through the communication means 9 in the operating range memory 11 and sequentially processes the data by means of the CPU 10 according to the system program stored in the system program memory 12.
In FIG. 6, the first step in the procedure is the setting of the conditions (timing, a certain data value, etc.) which will trigger data collection or designate the data which will be collected. Then, in step 201, data output via interface 3 is received and written in the work area memory 11 through the communication means 9. Then in step 202, it is judged whether the trigger condition(s) of data collection are established or not, for example whether the time measuring means 13 reaches a given time or not, whether certain conditions on the PC data are met or not and so on. If so, the process of data collection is started in step 203.
Step 203 is shown in detail in FIG. 7. When started in step 203, the process of reading out the appointed data from the PC is performed in step 204 and it is judged in step 205 whether it is possible to carry out file access to the collected data storage file 43 stored in the auxiliary storage 14. For example, if the collected data storage file 43 is not then being read out, file access is judged to be possible and the collected data storage file 43 is accessed so as to write the read out data 46 together with the collection time data thereinto. As shown in FIG. 9, the collection time data 45 and the read out collected data 46 are written and stored in the storage file 43 in a time serial manner.
Then in step 207, it is judged whether a writing error was generated due to, e.g., lack of capacity in the auxiliary storage 14 at the time of file writing. If writing can not be performed due to lack of capacity, it is necessary for the operator to delete a portion of collected data storage files 43. If the given conditions are not established in the respective judgements of steps 205 and 207, an error process is performed in step 208 and the start step 203 for the data collection process is completed in step 209.
Then in step 210, it is judged whether file compilation is required with respect to the collected data storage files 43, by checking the input means 15. When it is, the process of file compilation is started in step 211.
Step 211 is the process of file compilation, shown in detail in FIG. 8. Upon starting this process in step 211, range setting is performed in step 212 so as to set the extent to which the content of the collected data storage file 43 will be stored as a compilation file 44. This is carried out by, for example, appointing the start and end collection times. A search for the conditions set by the range setting process is performed in step 213.
Subsequently, step 214 performs the read process for reading out data from the collected data storage file 43, and step 215 performs the writing process to write the data read out in step 215 to form the compilation file 44 so as to complete the file compilation process.
It is judged in step 217 whether monitoring is completed or not. In case the completion condition is not established, the collected data are displayed by the display unit 16 in step 218 and the process returns to step 201 again so as to repeat the operation, initiating from the process of reading out the data received from the PC 1 in the operating range. If the completion condition is established in step 217, the monitoring completion process is performed in step 219 so as to complete the series of processes in step 220.
According to the conventional data collection method, there are problems in that the size of the collected data storage files 43 is increased by carrying out additional writing every time data is collected. It is necessary for the operator to know the residual storage capacity of the auxiliary storage 14 which stores the above-mentioned collected data storage files and to carry out file deletion when residual capacity becomes small. It is impossible to write the collected data into a collected data storage file when making up a compilation file because the collected data storage file is being read out when the compilation file is being made up.